﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
///  玩家积分情况
/// </summary>
public class IntegralModel
{

    /// <summary>
    /// 底分
    /// </summary>
    public int BasePoint;

    /// <summary>
    /// 倍数
    /// </summary>
    public int Multiple;

    /// <summary>
    /// 积分
    /// </summary>
    public int Result
    {
        get
        {
            return (Multiple * BasePoint);
        }
    }

    //各个玩家积分
    private int playerIntegration;
    private int computerLeftIntegration;
    private int computerRightIntegration;

    public int PlayerIntegration
    {
        get
        {
            return playerIntegration;
        }

        set
        {
            if (value < 0)
            {
                playerIntegration = 0;
            }
            else
            {
                playerIntegration = value;
            }
        }
    }

    public int ComputerLeftIntegration
    {
        get
        {
            return computerLeftIntegration;
        }

        set
        {
            if (value < 0)
            {
                computerLeftIntegration = 0;
            }
            else
            {
                computerLeftIntegration = value;
            }
        }
    }

    public int ComputerRightIntegration
    {
        get
        {
            return computerRightIntegration;
        }

        set
        {
            if (value < 0)
            {
                computerRightIntegration = 0;
            }
            else
            {
                computerRightIntegration = value;
            }

        }
    }

    /// <summary>
    ///  初始化玩家的信息
    /// </summary>
    public void InitIntegration()
    {
        BasePoint = 100;
        Multiple = 1;
        playerIntegration = 2000;
        computerLeftIntegration = 2000;
        computerRightIntegration = 2000;
    }

}
